FROM dns:1.0

MAINTAINER KiwenLau <kiwenlau@gmail.com>

# install openssh-server, vim and openjdk
RUN apt-get install -y openssh-server 

# move all configuration files into container
ADD files/* /usr/local/  

# set jave environment variable 
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64 
ENV PATH $PATH:$JAVA_HOME/bin

#configure ssh free key access
RUN mkdir /var/run/sshd && \
ssh-keygen -t rsa -f ~/.ssh/id_rsa -P '' && \
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys && \
mv /usr/local/ssh_config ~/.ssh/config && \
sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd

RUN chmod +x /usr/local/start-ssh-serf.sh 
#install hadoop 2.30
EXPOSE 22 7373 7946

CMD '/usr/local/start-ssh-serf.sh'; 'bash'

